#include "StdAfx.h"
#include "TwTextureDX.h"
#include "TwEngineDx.h "
#include <d3dx9tex.h>


TwTextureDX::TwTextureDX(void):
m_pd3dTexture(0)
,m_uTexID(0)
{
}

TwTextureDX::~TwTextureDX(void)
{
}
bool TwTextureDX::CreateTextureFromFile(const char* szFileName)
{
	if (g_Render && szFileName)
	{
		if( FAILED( D3DXCreateTextureFromFile( g_Render->GetDevice(), szFileName, &m_pd3dTexture ) ) )
		{
			return false;
		}
		return true;
	}
	return false;
}
void TwTextureDX:: SetTexID(const UINT32 uID)
{
	m_uTexID = uID;
}
const UINT32 TwTextureDX::GetTexID()const
{
	return m_uTexID; 
}
void TwTextureDX::Destroy()
{
	SAFE_DELETE(m_pd3dTexture);
	m_pd3dTexture = NULL;
}